package com.j2203.service.impl;

import com.j2203.entity.News;
import com.j2203.mapper.NewsMapper;
import com.j2203.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 查询所有
 * @Author: Captain
 * @Date: 2022/7/13 11:10
 * @version: 2019.1
 */
@Service
public class NewsServiceImpl implements NewsService {
    @Autowired(required = false)
    private NewsMapper newsMapper;
    @Override
    public List<News> selectAll() {
        List<News> list = newsMapper.selectAll();
        return list;
    }

/**
 * 单个查询
 *@Author:  Captain
 *@Date:  2022/7/13 15:22
 *@Versions:  2019.1.4
 */
    @Override
    public News selectOne(int gid) {
        News selectOne = newsMapper.selectOne(gid);
        return selectOne;
    }


}
